package leetcode.code068;

import java.util.List;

import leetcode.IDebug;
import leetcode.helper.HelpDebug;

public abstract class Solution068 implements IDebug {

	public abstract List<String> fullJustify(String[] words, int maxWidth);

	@Override
	public void debug1() {
		String str1 = "[\"This\",\"is\",\"an\",\"example\",\"of\",\"text\",\"justification.\"]";
		String str2 = "[\"This    is    an\",\"example  of text\",\"justification.  \"]";
		int maxWidth = 16;
		this.debug(str1, str2, maxWidth);
	}

	private void debug(String str1, String str2, int maxWidth) {
		String[] words = HelpDebug.str2array2(str1);
		List<String> expect = HelpDebug.str2liststr(str2);
		List<String> result = this.fullJustify(words, maxWidth);
		HelpDebug.compare(expect, result);
	}

	@Override
	public void debug2() {
		String str1 = "[\"What\",\"must\",\"be\",\"acknowledgment\",\"shall\",\"be\"]";
		String str2 = "[\"What   must   be\",\"acknowledgment  \",\"shall be        \"]";
		int maxWidth = 16;
		this.debug(str1, str2, maxWidth);
	}

	@Override
	public void debug3() {
		String str1 = "[\"Science\",\"is\",\"what\",\"we\",\"understand\",\"well\",\"enough\",\"to\",\"explain\",\"to\",\"a\",\"computer.\",\"Art\",\"is\",\"everything\",\"else\",\"we\",\"do\"]";
		String str2 = "[\"Science  is  what we\",\"understand      well\",\"enough to explain to\",\"a  computer.  Art is\",\"everything  else  we\",\"do                  \"]";
		int maxWidth = 20;
		this.debug(str1, str2, maxWidth);
	}

	@Override
	public void debug4() {
		String str1 = "[\"This\",\"is\",\"an\",\"example\",\"of\",\"text\",\"justification.\"]";
		String str2 = "[\"This    is    an\",\"example  of text\",\"justification.  \"]";
		int maxWidth = 16;
		this.debug(str1, str2, maxWidth);
	}

}
